<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/21
 * Time: 14:28
 */
namespace Home\Model;
use Think\Model;
class ActivityModel extends Model {

    protected $_auto = array(
        array('activity_date','mydate','1','callback'),
    );

    protected function mydate(){
        return date("Y-m-d H:i:s");
    }

    protected $_validate = array(
        array('activity_name','require','活动标题必须填写！'),
        array('activity_addr','require','活动地址必须填写！'),
        array('activity_time','require','活动时间必须填写！'),
        array('activity_launch_person','require','发布人必须填写！'),
        array('activity_phone','/^1[3|4|5|8][0-9]\d{4,8}$/','手机号码错误！','0','regex',1),
        array('activity_fee_stu','is_numeric','学生票费用格式错误','1','function'),
        array('activity_fee_adult','is_numeric','学生票费用格式错误','1','function'),
    );

    function getdate(){
        return date('Y-m-d');
    }

}